home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 11 / develop 11 code / The NetWork Project / Examples (Sources) / NetSim / HistogramUnit.p < prev    next >
Encoding:
Text File  |  1992-07-15  |  1.3 KB  |  46 lines  |  [TEXT/MPS ]

  1. unit histogramUnit;
  2.  
  3. { Copyright © G. Sawitzki, StatLab Heidelberg }
  4.  
  5. interface
  6.  
  7. uses types;
  8. {$Setc paranoia=true}        {test for conditions which simply should not happen.}
  9.  
  10. const
  11.     {maxclass = 127;  }    {maximum class in histogram. must be odd}
  12.     maxclass = 63;  {cells are 0..maxclass}
  13.  
  14. type
  15.     histtype = record
  16.         count        : longint; {total number of observations in histogram}
  17.         maxbincount    : longint; {maximum number of observations in one bin}
  18.         binwidth    : extended;{equidistant. not yet defined: inf.}
  19.         min, max    : extended;{min and max for histogram (not data)}
  20.         {cells are left=min+i*binwidth< x ≤right=min+(i+1)*binwidth. }
  21.         {right end needs to be included to allow calculation of distribution function}
  22.         cnt: array[0..maxclass] of longint;
  23.         id: str15;
  24.     end;
  25.  
  26.     tStatType = record
  27.         count: longint;
  28.         mean: extended;
  29.         ssq: extended;
  30.         min, max: extended;
  31.         id: str15;
  32.     end;
  33.  
  34. procedure initStat(var stat:tStatType;name:str15);
  35. procedure addstat (w: extended; var stat: tStatType);
  36.  
  37. procedure addbistat (x, y: extended; var xstat, ystat: tStatType; var xyssq: extended);
  38.  
  39.  
  40. procedure initHistogram (var hist: histtype;name:str15);
  41. procedure addhist (val: extended; var hist: histtype);
  42. function histogramcell(val: extended; var hist: histtype):integer;
  43.  
  44.     implementation
  45. {$I histogramunit.inc}
  46. end.